import ajax from '../../utils/ajax';

const form = document.forms.reg;

form.onsubmit = form_submit;


/**
 * 
 */
function form_submit(e) {
  e.preventDefault();
  ajax('post', '/api/userreg', {
    uid: form.uid.value,
    pwd: form.pwd.value,
  }).then(result => {
    alert(result.msg);
    location.replace('./login.html')
  })
}

